package com.zyy.topic.controller;

import com.zyy.api.pojo.LabelInfo;
import com.zyy.api.pojo.LabelNewsInfo;
import com.zyy.topic.service.TopicService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *@author zhangyangyang
 *@createTime 2023417 9:52
 *@description 主题对外服务接口
 */
@RestController
@RequestMapping("label")
@Slf4j
public class TopicServiceController {

    @Autowired
    private TopicService topicService;

    @PostMapping(value = "/analysisLabel", produces = MediaType.APPLICATION_JSON_VALUE,consumes = MediaType.APPLICATION_JSON_VALUE)
    public List<LabelInfo> analysisLabel(@RequestBody LabelNewsInfo info) {
        log.info("解析主题标签：{}", info);
        return topicService.analysisLabel(info);
    }
}
